package com.moneyanalyzer;

import java.util.List;

import com.moneyanalyzer.dao.CategoryDao;
import com.moneyanalyzer.model.Category;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.Menu;

public class ListCategory extends ListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_list_category);
		CategoryDao dao = CategoryDao.getInstance();
		List<Category> categoryList = dao.list(this);
		setListAdapter(new CategoryAdapter(this, categoryList));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.list_category, menu);
		return true;
	}

}
